<div class="deal">
<div class="deal_content_top"></div>
<div class="deal_content">
<h3>Danh sách các phiếu giảm giá</h3>

<div align="center" style="background-color: white;">
	<form action="<?php echo $this->baseUrl("index.php/admin_cms/deal") ?>" method="get">
		<table>
			<tr>
				<td><strong>Tìm kiếm</strong></td>
				<td>
					<input type="text" name="filter" value="<?php if(isset($this->filter)) echo $this->filter; ?>" />
				</td>
				<td>
					<input type="submit" value="Tìm" />
				</td>
			</tr>
		</table>
	</form>
</div>

<table class="table-style" style="width: 100%;" cellpadding="5px"
	cellspacing="0">
	<tbody>
		<tr class="table-title">
			<td><a href="<?php echo $this->baseUrl("index.php/admin_cms/deal") ?>?by=d.deal_id&order=<?php echo ($this->by != "d.deal_id" || $this->order == "desc") ? "asc" : "desc"; ?><?php if($this->filter != "") echo "&filter=".$this->filter; ?>">ID</a></td>
			<td><a href="<?php echo $this->baseUrl("index.php/admin_cms/deal") ?>?by=d.deal_title&order=<?php echo ($this->by != "d.deal_title" || $this->order == "desc") ? "asc" : "desc"; ?><?php if($this->filter != "") echo "&filter=".$this->filter; ?>">Name</a></td>
			<td><a href="<?php echo $this->baseUrl("index.php/admin_cms/deal") ?>?by=c.name&order=<?php echo ($this->by != "c.name" || $this->order == "desc") ? "asc" : "desc"; ?><?php if($this->filter != "") echo "&filter=".$this->filter; ?>">Category</a></td>
			<td><a href="#">Barcode</a></td>
			<td>&nbsp;</td>
		</tr>
		<?php
		if (count($this->paginator) == 0) {
			echo "<tr><td colspan='3' align='center'>No deal</td></tr>";
		} else {
			?>
			<?php $i = 0 ?>
			<?php foreach ($this->paginator as $deal): ?>
			<?php $i++ ?>
		<tr class="<?php echo $i % 2 == 0 ? 'even' : 'odd' ?>">
			<td><?php echo $deal->deal_id ?></td>
			<td><?php echo $deal->deal_title ?></td>
			<td><?php echo $deal->name ?></td>
			<td><a href="<?php echo $this->baseUrl('index.php/admin_cms/barcode/index/deal_id/' . $deal->deal_id) ?>">Chi tiết</a></td>
			<td align="right"><a
				href="<?php echo $this->baseUrl('index.php/admin_cms/deal/edit/id/' . $deal->deal_id) ?>">
			<img alt="Edit"
				src="<?php echo $this->baseUrl('public/images/edit.png') ?>"> </a> <a
				href="<?php echo $this->baseUrl('index.php/admin_cms/deal/delete/id/' . $deal->deal_id) ?>"
				onclick="if(!confirm('Delete ?',''))return false;"> <img
				alt="Delete"
				src="<?php echo $this->baseUrl('public/images/delete.png') ?>"> </a>
			</td>
		</tr>
		<?php endforeach ?>
		<?php } ?>
	</tbody>
</table>
		<?php echo $this->placeholder('paging') ?>
<p><span class="button"> <a
	href="<?php echo $this->baseUrl('index.php/admin_cms/deal/add') ?>">Thêm</a></span></p>
<?php echo $this->paginator; ?>

</div>

<div class="deal_content_bottom"></div>
</div>
